﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.BizTalk.ExplorerOM;

namespace DBLOG.BizTalk.BizTalkExplorerServices.Core
{
    public class SendPortExplorer : BizTalkExplorerBase
    {
        public List<SendPort> GetSendPorts()
        {
            return this._explorer.SendPorts.Cast<SendPort>().ToList<SendPort>();
        }

        public List<SendPort> GetDisabledSendPorts()
        {
            SendPortCollection sendPorts = this._explorer.SendPorts;

            List<SendPort> listSendPorts = sendPorts.Cast<SendPort>().ToList<SendPort>();

            var suspendedPorts = from s in listSendPorts
                                    where s.Status == PortStatus.Stopped
                                    select s;

            return suspendedPorts.ToList<SendPort>();
        }
    }
}